package redis

// 字符串命令
func Set(key, value string) (string, error) {
	return insRedis.String("SET", key, value)
}

func Get(key string) (string, error) {
	return insRedis.String("GET", key)
}

func SetEx(key, value string, seconds int) (string, error) {
	return insRedis.String("SETEX", key, seconds, value)
}

func SetNx(key, value string) (int, error) {
	return insRedis.Int("SETNX", key, value)
}

func PSetEx(key, value string, milliseconds int) (string, error) {
	return insRedis.String("PSETEX", key, milliseconds, value)
}

func GetSet(key, value string) (string, error) {
	return insRedis.String("GETSET", key, value)
}

func GetRange(key string, start, end int) (string, error) {
	return insRedis.String("GETRANGE", key, start, end)
}

func Incr(key string) (int64, error) {
	return insRedis.Int64("INCR", key)
}

func IncrBy(key string, increment int) (int64, error) {
	return insRedis.Int64("INCRBY", key, increment)
}

func Decr(key string) (int64, error) {
	return insRedis.Int64("DECR", key)
}

func DecrBy(key string, decrement int) (int64, error) {
	return insRedis.Int64("DECRBY", key, decrement)
}

func Append(key, value string) (int, error) {
	return insRedis.Int("APPEND", key, value)
}

func Strlen(key string) (int, error) {
	return insRedis.Int("STRLEN", key)
}
